<#assign base=request.contextPath />
<!DOCTYPE html>
<html>
<head>
  <base href="${base}">	
  <meta charset="utf-8">
  <title>组织机构树</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${base}/layuiadmin/layui/css/layui.css" media="all">
  <style>
  .auth-status {align-items: center !important;}
  </style>
</head>

<body>
  	<div class="layui-form" lay-filter="LAY-form-list">
    	<div class="layui-form-item">
	        <div style="margin-left: 20px">
	            <div id="LAY-auth-tree"></div>
	        </div>
    	</div>
  	</div>

  <script src="${base}/layuiadmin/layui/layui.js"></script>  
  <script>
  	layui.config({
    	base: '${base}/layuiadmin/' //静态资源所在路径
  	}).extend({
    	index: 'lib/index',
    	jwt: '{/}${base}/js/lib/jwt',
    	authtree: '{/}${base}/js/lib/authtree'
  	}).use(['index', 'jwt', 'authtree'], function(){
    	var $ = layui.$;
    	var jwt = layui.jwt;
    	window.authtree = layui.authtree;
    	
    	$.ajax({
    		url: '${base}/system/dept/orgTree?ids=${ids}',
    		success: function(data) {
    			var trees = data;
    			// 取得数据
    	    	authtree.render('#LAY-auth-tree', trees, {
    				inputname: 'authids', 
    				layfilter: 'lay-check-auth',
    				autochecked: false,
    				autoclose: false,
    				autowidth: true,
    			});
    	    	authtree.showDept('#LAY-auth-tree', 2);
    		}    		
    	});    	
  	})
  </script>
</body>
</html>